<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script type="text/javascript">
        var str = prompt("亲输入数组");
        var strArr = new Array();
        strArr = str.split(",")

        var sum = 0;
        for (i = 0; i < strArr.length - 1; i++) {
            var num = strArr[i + 1] - strArr[i];
            if (sum < num) {
                sum = num;
            }
        }
        document.write(sum);
    </script>
</head>

<body>
</body>

</html>